﻿using System.Linq;
using WeBlog.Interfaces;
using WeBlog.Repositories;

namespace WeBlog.Models
{
    public class ManageTagsViewModel : GridModel<Tag>
    {
        private readonly TagRepository _tagRepository;

        public ManageTagsViewModel( GridSettings settings, IUnitOfWork unitOfWork ) 
            : base( settings )
        {
            settings.DefaultSortColumn = "Name";            
            _tagRepository = new TagRepository(unitOfWork);
        }

        public override IQueryable<Tag> GetSuperSet()
        {
            return _tagRepository.FindAll();
        }
    }
}